@extends('develop.layoutList')

@section('title')
    <li class="cur">
        <span>APP版本设置</span>
    </li>
@endsection

@section('btn')
    <button class="btn btn-primary" type="button" onclick="app.edit(0);">添加</button>
@endsection

@section('search')

    <div class="form-group">
        <select name="appType" id="appType" class="form-control">
            <option value="0">平台类型</option>
            <option value="1">ios</option>
            <option value="2">android</option>
        </select>
    </div>
    <input id="appVersionCode" class="form-control" type="text" value="" name="appVersionCode" placeholder="请输入版本code" >

@endsection

@section('js')
    <script>
        var bootstrap_table_ajax_url = '/lar/develop/app/search';
        bootstrap_table({
            sortName: 'createTime', //排序字段
            sortOrder: 'DESC',//排序方式
            columns: [ //字段
                { title: '操作', field: 'operation', align: 'center' },
                { title: '平台类型', field: 'appType', align: 'left'  },
                { title: '版本code', field: 'appVersionCode', align: 'left'  },
                { title: '版本编号',  field: 'appVersionNumber', align: 'left' },
                { title: '创建人', field: 'creator', align: 'left' },
                { title: '创建时间', field: 'createTime', align: 'left' }
            ]
        });
        var app = {

            edit: function (appVersionId,flag) {
                var content = '';
                if (appVersionId ) {
                    content = '/lar/develop/app/edit/'+'&appVersionId='+appVersionId+'&flag='+flag;
                } else {
                    content = '/lar/develop/app/edit/'+'&appVersionId='+appVersionId+'&flag='+flag;
                }
                this.layer_index = layer.open({
                    title: false,
                    type: 2,
                    area: ['100%','100%'],
                    scrollbar: false,
                    content: content,
                    closeBtn: false
                });

            },

            //重新加载表格
            load: function() {
                //刷新表格
                $('#table').bootstrapTable('refresh');
            }
        };
    </script>
@endsection